@layout("/common/_container.html",{js:["/assets/modular/system/project/project_premises.js"]}){
<style>
    .input {
        border: none;
    }

    .editinput {
        width: 60px;
    }

    .layui-table tbody tr:hover,
    .layui-table thead tr,
    .layui-table-click,
    .layui-table-header,
    .layui-table-hover,
    .layui-table-mend,
    .layui-table-patch, .layui-table-tool,
    .layui-table-total, .layui-table-total tr, .layui-table[lay-even] tr:nth-child(even) {
        background-color: #FFFFFF;
    }

    td {
        white-space: nowrap;
    }

    .uploader-list {
        margin-left: -15px;
    }

    .uploader-list .info {
        position: relative;
        margin-top: -25px;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 100%;
        height: 25px;
        text-align: center;
        display: none;
    }

    .uploader-list .handle {
        position: relative;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 100%;
        text-align: right;
        height: 18px;
        margin-bottom: -18px;
        display: none;
    }

    .uploader-list .handle span {
        margin-right: 5px;
    }

    .uploader-list .handle span:hover {
        cursor: pointer;
    }

    .uploader-list .file-iteme {
        margin: 12px 0 0 15px;
        padding: 1px;
        float: left;
    }
</style>
</head>
<body>
<div class="testdiv">
    <table class="layui-table" style="width: 50%;margin: 0 auto">
        <tbody>
        <tr>
            <td colspan="5" style="text-align: center">
                半天妖店铺复尺一览表
            </td>
        </tr>
        <tr>
            <td colspan="5"><span style="color: red">*</span>店铺名称: <input class="input" id="dpName"/></td>
        </tr>
        <tr>
            <td>商场楼层</td>
            <td><input class="input editinput" id="sclc"/></td>
            <td>所在楼层</td>
            <td colspan="2"><input class="input editinput" id="szlc"/></td>
        </tr>
        <tr>
            <td rowspan="2">店铺性质</td>
            <td><input type="radio" name="shop" value="新开商城">新开商城</td>
            <td colspan="3"><input type="radio" name="shop" value="已开商城">已开商城（<input class="input editinput" id="yksc"
                                                                                     style="text-align: center"/>年）
            </td>
        </tr>
        <tr>
            <td><input type="radio" name="shop" value="街边店">街边店</td>
            <td colspan="3"><input type="radio" name="shop" value="原铺重装">原铺重装</td>
        </tr>
        <tr>
            <td>店铺面积</td>
            <td><input class="input editinput" id="dpArea"/>m²</td>
            <td colspan="3"></td>
        </tr>
        <tr>
            <td rowspan="2">入口设计</td>
            <td><input type="radio" name="isDesign" value="可做开放性设计">可做开放性设计</td>
            <td colspan="3"><input type="radio" name="isDesign" value="可用水晶卷帘">可用水晶卷帘</td>
        </tr>
        <tr>
            <td><input type="radio" name="isDesign" value="不可做开放性设计">不可做开放性设计</td>
            <td colspan="3">玻璃厚度</td>
        </tr>
        <td rowspan="2">红线墙体</td>
        <td>负责建墙</td>
        <td><input type="radio" name="isWalls" value="我方">我方</td>
        <td><input type="radio" name="isWalls" value="临铺方">临铺方</td>
        <td><input type="radio" name="isWalls" value="商场">商场</td>
        </tr>
        <tr>
            <td>建墙位置</td>
            <td><input type="radio" name="location" value="向内">向内</td>
            <td><input type="radio" name="location" value="向外">向外</td>
            <td><input type="radio" name="location" value="居中">居中</td>
        </tr>
        <tr>
            <td rowspan="3">标高</td>
            <td>建筑层高</td>
            <td><input class="input editinput" id="jzcg"/></td>
            <td>梁下高度</td>
            <td><input class="input editinput" id="lxcg"/></td>
        </tr>
        <tr>
            <td>喷淋距地</td>
            <td><input class="input editinput" id="pljd"/></td>
            <td>最低点</td>
            <td><input class="input editinput" id="lowest"/></td>
        </tr>
        <tr>
            <td>公区层高</td>
            <td><input class="input editinput" id="gqucg"/></td>
            <td>门楣高度</td>
            <td><input class="input editinput" id="mmgd"/></td>
        </tr>
        <tr>
            <td rowspan="2">上下水位</td>
            <td>上水</td>
            <td>型号</td>
            <td><input type="radio" name="isMovable" value="不可移">不可移</td>
            <td><input type="radio" name="isMovable" value="可移">可移</td>
        </tr>
        <tr>
            <td>下水</td>
            <td>型号</td>
            <td><input type="radio" name="movable" value="不可移">不可移</td>
            <td><input type="radio" name="movable" value="可移">可移</td>
        </tr>
        <tr>
            <td rowspan="4">电</td>
            <td>电箱</td>
            <td><input type="radio" name="box" value="不可移">不可移</td>
            <td><input type="radio" name="box" value="可移">可移</td>
            <td></td>
        </tr>
        <tr>
            <td rowspan="2">电缆</td>
            <td>现电缆容量</td>
            <td><input class="input editinput" id="dlrl"/></td>
            <td>需增加</td>
        </tr>
        <tr>
            <td>型号</td>
            <td colspan="2"><input class="input editinput" id="dlxh"/></td>
        </tr>
        <tr>
            <td>开关型号</td>
            <td colspan="3"><input class="input editinput" id="kgxh"/></td>
        </tr>
        <tr>
            <td rowspan="3">空调</td>
            <td><input type="radio" name="isAdded" value="无需新增">无需新增（现有<input class="input editinput" id="xz"
                                                                              style="text-align: center"/>台）
            </td>
            <td colspan="3"><input type="radio" name="isAdded" value="需新增">需新增<input class="input editinput" id="needXz"
                                                                                     style="text-align: center"/>台
            </td>
        </tr>
        <tr>
            <td rowspan="2">机位</td>
            <td><input type="radio" name="seat" value="有">有</td>
            <td>一拖一</td>
            <td>铜管<input class="input editinput" id="tg" style="text-align: center"/>米</td>
        </tr>
        <tr>
            <td><input type="radio" name="seat" value="无">无</td>
            <td>多联机</td>
            <td>铜管<input class="input editinput" id="dljtg" style="text-align: center"/>米</td>
        </tr>
        <tr>
            <td>消防栓</td>
            <td><input type="radio" name="hydrant" value="不可移">不可移</td>
            <td></td>
            <td><input type="radio" name="hydrant" value="可移">可移</td>
            <td></td>
        </tr>
        <tr>
            <td>消防门</td>
            <td><input type="radio" name="isSealable" value="不可封/移">不可封/移</td>
            <td><input type="radio" name="isSealable" value="可封">可封<input class="input editinput" id="kyNumber"
                                                                          style="text-align: center"/>个
            </td>
            <td></td>
            <td>可否在厨房</td>
        </tr>
        <tr>
            <td rowspan="3">燃气管道</td>
            <td><input type="radio" name="isDetachable" value="不可拆">不可拆</td>
            <td></td>
            <td><input type="radio" name="detachable" value="不可移">不可移</td>
            <td></td>
        </tr>
        <tr>
            <td rowspan="2"><input type="radio" name="isDetachable" value="可拆">可拆</td>
            <td rowspan="2"><input type="radio" name="detachable" value="可移">可移</td>
            <td><input type="radio" name="isWho" value="我方施工">我方施工</td>
            <td></td>
        </tr>
        <tr>
            <td><input type="radio" name="isWho" value="他方施工">他方施工</td>
            <td></td>
        </tr>
        <tr>
            <td>消防二次改造</td>
            <td><input type="radio" name="isSecondary" value="不可改">不可改</td>
            <td><input type="radio" name="isSecondary" value="可改">可改</td>
            <td>维保电话</td>
            <td><input class="input editinput" id="wbdh" style="width: 150px"/></td>
        </tr>
        <tr>
            <td rowspan="2">排烟接口</td>
            <td>尺寸:800*600</td>
            <td><input class="input editinput" id="pySize"/></td>
            <td>路由:</td>
            <td><input class="input editinput" id="pyluy"/></td>
        </tr>
        <tr>
            <td>机位</td>
            <td><input type="radio" name="isIndoor" value="店内">店内</td>
            <td><input type="radio" name="isIndoor" value="室外">室外</td>
            <td></td>
        </tr>
        <tr>
            <td rowspan="2">新风口</td>
            <td>尺寸:500*300</td>
            <td><input class="input editinput" id="xfSize"/></td>
            <td><input class="input editinput"/></td>
            <td><input class="input editinput"/></td>
        </tr>
        <tr>
            <td>机位</td>
            <td><input type="radio" name="indoor" value="店内">店内</td>
            <td><input type="radio" name="indoor" value="室外">室外</td>
            <td></td>
        </tr>
        <tr>
            <td>外租仓库</td>
            <td><input type="radio" name="isLeased" value="有">有
                <input type="radio" name="isLeased" value="无">无
            </td>
            <td></td>
            <td>面积</td>
            <td><input class="input editinput" id="mj"/></td>
        </tr>
        <tr>
            <td>楼体伸缩缝</td>
            <td><input type="radio" name="isFloor" value="无">无</td>
            <td><input type="radio" name="isFloor" value="有">有</td>
            <td colspan="2">需做水接盘设计</td>
        </tr>
        <tr>
            <td>店内卫生</td>
            <td><input type="radio" name="hygiene" value="无需设计">无需设计</td>
            <td>使用商场内</td>
            <td><input type="radio" name="hygiene" value="需设计">需设计</td>
            <td></td>
        </tr>
        <tr>
            <td>围挡搭建</td>
            <td><input type="radio" name="isBuild" value="商场搭建">商场搭建</td>
            <td></td>
            <td><input type="radio" name="isBuild" value="我方搭建">我方搭建</td>
            <td></td>
        </tr>
        <tr>
            <td>照片</td>
            <td><input type="hidden" name="wwztimg" id="wwztimg">
                <div class="layui-upload">
                    <button type="button" class="layui-btn" id="many_wwztimg_upload_btn">照片</button>
                    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                        预览图：
                        <div class="layui-upload-list uploader-list" style="overflow: auto;"
                             id="uploader-list-wwztimg"></div>
                    </blockquote>
                </div>
            </td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>店铺入口位置</td>
            <td colspan="4"><input class="input editinput" id="entrance" style="width: 90%"/></td>
        </tr>
        </tbody>
    </table>
</div>
<div class="layui-inline" style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
    <button id="btnExp" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>下载
    </button>
    <button id="btnKeep" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>保存
    </button>
    <button id="backupPage" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>返回
    </button>
</div>
</body>

<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="application/javascript">
    const id = '${id}';
    const lists = [${list}];
    var list = [];

    $(function () {
        for (let i = 0; i < lists[0][0].length; i++) {
            let pinCode = lists[0][0][i].pinCode;
            $("#" + pinCode + "").val(lists[0][0][i].data);
            $("#" + pinCode + "").attr("readonly", true);
        }
    });

    $('#btnKeep').click(function () {
        for (let i = 1; i < 23; i++) {
            var object = {};
            if (i == 1) {
                object.proId = id;
                object.mouldId = "39";
                object.dataType = 1;
                object.data = $('#dpName').val();
                object.pinCode = "dpName";
            } else if (i == 2) {
                object.simpleName = "商场楼层";
                object.dataType = 1;
                object.data = $('#sclc').val();
                object.pinCode = "sclc";
            } else if (i == 3) {
                object.simpleName = "所在楼层";
                object.dataType = 1;
                object.data = $('#szlc').val();
                object.pinCode = "szlc";
            } else if (i == 4) {
                object.simpleName = "店铺性质";
                object.dataType = 2;
                object.data = $('input[name="shop"]').val();
                object.pinCode = "shop";
            } else if (i == 5) {
                object.simpleName = "店铺面积";
                object.dataType = 1;
                object.data = $('#dpArea').val() ;
                object.pinCode = "dpArea";
            } else if (i == 6) {
                object.simpleName = "入口设计";
                object.dataType = 2;
                object.data = $('input[name="isDesign"]').val();
                object.pinCode = "isDesign";
            } else if (i == 7) {
                object.simpleName = "红线墙体";
            } else if (i == 8) {
                object.simpleName = "建墙位置";
            } else if (i == 9) {
                object.simpleName = "标高";
            } else if (i == 10) {
                object.simpleName = "上下水位";
            } else if (i == 11) {
                object.simpleName = "电";
            } else if (i == 12) {
                object.simpleName = "空调";
                object.dataType = 2;
                object.data = $('input[name="isAdded"]:checked').val();
                object.pinCode = "isAdded";
            } else if (i == 13) {
                object.simpleName = "消防栓";
                object.dataType = 2;
                object.data = $('input[name="hydrant"]:checked').val();
                object.pinCode = "hydrant";
            } else if (i == 14) {
                object.simpleName = "消防门";
                object.dataType = 2;
                object.data = $('input[name="isSealable"]:checked').val();
                object.pinCode = "isSealable";
            } else if (i == 15) {
                object.simpleName = "燃气管道";
                object.dataType = 2;
                object.data = $('input[name="isDetachable"]:checked').val();
                object.pinCode = "isDetachable";
            } else if (i == 16) {
                object.simpleName = "燃气管道";
                object.dataType = 2;
                object.data = $('input[name="detachable"]:checked').val();
                object.pinCode = "detachable";
            } else if (i == 17) {
                object.simpleName = "燃气管道";
                object.dataType = 2;
                object.data = $('input[name="isWho"]:checked').val();
                object.pinCode = "isWho";
            } else if (i == 18) {
                object.simpleName = "消防二次改造";
                object.dataType = 2;
                object.data = $('input[name="isSecondary"]:checked').val();
                object.pinCode = "isSecondary";
            } else if (i == 19) {
                object.simpleName = "排烟接口";
            } else if (i == 20) {
                object.simpleName = "新风口";
            } else if (i == 21) {
                object.simpleName = "外租仓库";
                object.dataType = 2;
                object.data = $('input[name="isLeased"]:checked').val();
                object.pinCode = "isLeased";
            } else if (i == 22) {
                object.simpleName = "面积";
                object.dataType = 1;
                object.data = $('#mj').val();
                object.pinCode = "mj";
            } else if (i == 23) {
                object.simpleName = "楼体伸缩缝";
                object.dataType = 2;
                object.data = $('input[name="isFloor"]:checked').val();
                object.pinCode = "isFloor";
            } else if (i == 24) {
                object.simpleName = "店内卫生";
                object.data = $('input[name="hygiene"]:checked').val();
                object.pinCode = "hygiene";
                object.dataType = 2;
            } else if (i == 25) {
                object.simpleName = "围挡搭建";
                object.dataType = 2;
                object.data = $('input[name="isBuild"]:checked').val();
                object.pinCode = "isBuild";
            } else if (i == 26) {
                object.simpleName = "照片";
                object.dataType = 5;
                object.data = $('#uploader-list-wwztimg').val();
                object.pinCode = "uploader-list-wwztimg";
            } else if (i == 27) {
                object.simpleName = "店铺入口位置";
                object.dataType = 1;
                object.data = $('#entrance').val();
                object.pinCode = "entrance";
            }
            object.sort = i;
            list.push(object);
        }
        for (let j = 28; j < 30; j++) {
            var object = {};
            if (j == 28) {
                object.simpleName = "负责建墙";
                object.dataType = 2;
                object.data = $('input[name="isWalls"]:checked').val();
                object.pinCode = "isWalls";
            } else if (j == 29) {
                object.simpleName = "建墙位置";
                object.dataType = 2;
                object.data = $('input[name="location"]:checked').val();
                object.pinCode = "location";
            }
            object.sort = j;
            list.push(object);
        }
        for (let k = 30; k < 33; k++) {
            var object = {};
            if (k == 30) {
                object.simpleName = "建筑层高";
                object.dataType = 1;
                object.data = $('#jzcg').val();
                object.pinCode = "jzcg";
            } else if (k == 31) {
                object.simpleName = "梁下高度";
                object.dataType = 1;
                object.data = $('#lxcg').val();
                object.pinCode = "lxcg";
            } else if (k == 32) {
                object.simpleName = "喷淋距地";
                object.dataType = 1;
                object.data = $('#pljd').val();
                object.pinCode = "pljd";
            } else if (k == 33) {
                object.simpleName = "最低点";
                object.dataType = 1;
                object.data = $('#lowest').val();
                object.pinCode = "lowest";
            } else if (k == 34) {
                object.simpleName = "公区层高";
                object.dataType = 1;
                object.data = $('#gqucg').val();
                object.pinCode = "gqucg";
            } else if (k == 35) {
                object.simpleName = "门楣高度";
                object.dataType = 1;
                object.data = $('#mmgd').val();
                object.pinCode = "mmgd";
            }
            object.sort = k;
            list.push(object)
        }
        // 上下水位
        for (let y = 36; y < 38; y++) {
            var object = {};
            if (y == 36) {
                object.simpleName = "上水";
            } else if (y == 37) {
                object.simpleName = "下水";
            }
            object.sort = y;
            list.push(object)
        }
        // 电
        for (let h = 38; h < 41; h++) {
            var object = {};
            if (h == 38) {
                object.simpleName = "电箱";
                object.dataType = 2;
                object.data = $('input[name="box"]:checked').val();
                object.pinCode = "box";
            } else if (h == 39) {
                object.simpleName = "电缆";
            } else if (h == 40) {
                object.simpleName = "开关型号";
                object.dataType = 1;
                object.data = $('#kgxh').val();
                object.pinCode = "kgxh";
            }
            object.sort = h;
            list.push(object);
        }
        // 空调机位
        for (let m = 41; m < 43; m++) {
            var object = {};
            if (m == 41) {
                object.simpleName = "机位";
                object.dataType = 2;
                object.data = $('input[name="seat"]:checked').val();
                object.pinCode = "seat";
            }
            object.sort = m;
            list.push(object);
        }
        for (let p = 42; p < 44; p++) {
            var object = {};
            if (p == 42) {
                object.simpleName = "维保电话";
                object.dataType = 1;
                object.data = $('#wbdh').val();
                object.pinCode = "wbdh";
            }
            object.sort = p;
            list.push(object);
        }
        for (let p = 43; p < 46; p++) {
            var object = {};
            if (p == 43) {
                object.simpleName = "尺寸:800*600";
                object.dataType = 1;
                object.data = $('#pySize').val();
                object.pinCode = "pySize";
            } else if (p == 44) {
                object.simpleName = "路由:";
                object.dataType = 1;
                object.data = $('#pyluy').val();
                object.pinCode = "pyluy";
            } else if (p == 45) {
                object.simpleName = "机位";
                object.dataType = 2;
                object.data = $('input[name="isIndoor"]:checked').val();
                object.pinCode = "isIndoor";
            }
            object.sort = p;
            list.push(object);
        }
        for (let d = 46; d < 47; d++) {
            var object = {};
            if (d == 46) {
                object.simpleName = "型号";
                object.dataType = 2;
                object.data = $('input[name="isMovable"]:checked').val();
                object.pinCode = "isMovable";
            }
            object.sort = d;
            list.push(object);
        }
        for (let a = 47; a < 48; a++) {
            var object = {};
            if (a == 47) {
                object.simpleName = "型号";
                object.dataType = 2;
                object.data = $('input[name="movable"]:checked').val();
                object.pinCode = "movable";
            }
            object.sort = a;
            list.push(object);
        }
        for (let g = 48; g < 50; g++) {
            var object = {};
            if (g == 48) {
                object.simpleName = "现电缆容量";
                object.dataType = 1;
                object.data = $('#dlrl').val();
                object.pinCode = "dlrl";
            } else if (g == 49) {
                object.simpleName = "现电缆容量";
                object.dataType = 1;
                object.data = $('#dlxh').val();
                object.pinCode = "dlxh";
            }
            object.sort = g;
            list.push(object);
        }
        for (let x = 50; x < 52; x++) {
            var object = {};
            if (x == 50) {
                object.simpleName = "一拖一";
                object.dataType = 1;
                object.data = $('#tg').val() ;
                object.pinCode = "tg";
            } else if (x == 51) {
                object.simpleName = "多联机";
                object.dataType = 1;
                object.data = $('#dljtg').val();
                object.pinCode = "dljtg";
            }
            object.sort = x;
            list.push(object);
        }
        $.ajax({
            type: "post",
            url: "/mouldBoardMsg/add",
            data: JSON.stringify(list),
            contentType: 'application/json',
            async: false,
            success: function (data) {
                list = [];
                window.location.reload();
            }
        });
    })

</script>

@}